﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Imports Utilerias
Imports Npgsql
Imports MySql.Data.MySqlClient
Public Class FormapagFact
    Public Shared Function Build(ByVal dr As MySqlDataReader) As FormapagBE
        Dim tmpFormapag As FormapagBE = New FormapagBE()
        Try
            With tmpFormapag
                '.IdEmpresa = convertDTFromDb.convertInt32(dr.Item("IdEmpresa"))
                .IdFormaP = convertDTFromDb.convertInt32(dr.Item("IdFormaP"))
                .DesFormaP = convertDTFromDb.ConvertString(dr.Item("DesFormaP"))
                Select Case convertDTFromDb.ConvertString(dr.Item("Status"))
                    Case "A"
                        .Status = FormapagBE.EstatusFormapag.Activa
                    Case "I"
                        .Status = FormapagBE.EstatusFormapag.Inactiva
                    Case Else
                        .Status = FormapagBE.EstatusFormapag.Inactiva
                End Select
            End With
            Return tmpFormapag
        Catch ex As Exception
            Throw
        Finally
            tmpFormapag = Nothing
        End Try
    End Function
End Class
